package com.gxar.quick.ar.server.base.model.protocol.client.wechat_mp;

import com.gxar.quick.ar.server.base.model.protocol.common.CommonArItemAnimationModel;
import lombok.Data;

import java.util.Objects;

/**
 * 微信小程序 - 动画配置信息
 *
 * @author zxh
 * @version 1.0
 * @created 2024/01/02.
 */
@Data
public class WechatMpClientArItemAnimationModel {

    /**
     * 动画类型
     */
    private String type;

    /**
     * 行数
     */
    private Integer rowCount;

    /**
     * 列数
     */
    private Integer columnCount;

    /**
     * 帧数
     */
    private Integer frames;

    /**
     * 持续时长
     */
    private Double during;

    public static WechatMpClientArItemAnimationModel from(CommonArItemAnimationModel inputModel) {
        if (Objects.isNull(inputModel)) {
            return null;
        }
        WechatMpClientArItemAnimationModel outputModel = new WechatMpClientArItemAnimationModel();

        outputModel.setType(inputModel.getType());
        outputModel.setRowCount(inputModel.getRowCount());
        outputModel.setColumnCount(inputModel.getColumnCount());
        outputModel.setFrames(inputModel.getFrames());
        outputModel.setDuring(inputModel.getDuring());

        return outputModel;
    }
}
